function longestWord(words: string[]): string {
    const newArr = words.filter(item => {
        let result = false
        words.map(i => {
            if(item.includes(i)){
                result = true
            }
        })
        console.log(result)
        return result
    })
    console.log("app".includes('apppl'))
    return words[0]
};

const words: string[] = ["a", "banana", "app", "appl", "ap", "apply", "apple"]
longestWord(words)